import request from '@/utils/request'

//设备设置列表

export function listDevice(){
  return request({
    url: '/device/Setting/list',
    method: 'get',
  })
}

// 查询充电桩管理列表
export function listManager(query) {
  return request({
    url: '/business/manager/list',
    method: 'get',
    params: query
  })
}

// 查询充电桩管理详细
export function getManager(deviceId) {
  return request({
    url: '/business/manager/' + deviceId,
    method: 'get'
  })
}
// 查询充电桩管理详细
export function getManagerDetail(deviceId) {
  return request({
    url: '/business/manager/detail/' + deviceId,
    method: 'get'
  })
}
// 查询充电桩设置详细
export function getBasisInfo(deviceId) {
  return request({
    url: `/business/info/basis/list/${deviceId}`,
    method: 'get'
  })
}
// 查询充电桩设置详细
export function getInfo(deviceId) {
  return request({
    url: '/business/info/' + deviceId,
    method: 'get'
  })
}

// 新增充电桩管理
export function addManager(data) {
  return request({
    url: '/business/manager',
    method: 'post',
    data: data
  })
}

// 修改充电桩管理
export function updateManager(data) {
  return request({
    url: '/business/manager',
    method: 'put',
    data: data
  })
}

// 删除充电桩管理
export function delManager(deviceId) {
  return request({
    url: '/business/manager/' + deviceId,
    method: 'delete'
  })
}

// 设置充电桩管理
export function setManager(data) {
  return request({
    url: '/business/info',
    method: 'put',
    data: data
  })
}

// 根据设备和枪口号生成二维码内容
export function getQrcode(deviceId, port) {
  return request({
    url: '/device/qrcode/url/' + deviceId + '/' + port,
    method: 'get'
  })
}

export function managerRestart(deviceId) {
  return request({
    url: `/business/manager/restart/${deviceId}`,
    method: 'post'
  })
}

export function hotMapList(deviceId,year) {
  return request({
    url: `/business/manager/hotMapList/${deviceId}/${year}`,
    method: 'get'
  })
}
